﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache">
<title>WebNoteEditor</title>
<link rel="STYLESHEET" type="text/css" id="SkinStyleSheet">
<script language="javascript" type="text/javascript" src="../script/windialog.js"></script>
<script language="javascript" type="text/javascript" src="../script/ie2w3c-min.js"></script>
<script language="javascript" type="text/javascript">
window.onload=function()
{
	renderWindowAsIE(window);
	AutoResizeDialogWindow();
}

function __btnOk_onclick()
{
	window.returnValue=getTableHTML();
	window.close();
}


function __btnCancel_onclick()
{
	window.close();
}

function __checkbox0_onclick()
{
	if (document.getElementById("checkbox0").checked)
	{
		document.getElementById("pwidth").disabled=false;
		document.getElementById("radio1").disabled=false;
		document.getElementById("radio2").disabled=false;
	}
	else
	{	
		document.getElementById("pwidth").disabled=true;
		document.getElementById("radio1").disabled=true;
		document.getElementById("radio2").disabled=true;
	}
}

function getTableHTML()
{
	var tablehtml="";
	var innerHTML="";
	if (!EditorWindow.$browser.isIE)
		innerHTML="&nbsp;";
	
	tablehtml=tablehtml+"<table ";
	if (document.getElementById("align").value=="left"||document.getElementById("align").value=="center"||document.getElementById("align").value=="right")
	 	tablehtml=tablehtml+"align="+document.getElementById("align").value+" ";
	if (document.getElementById("border")!="")
	 	tablehtml=tablehtml+"border="+document.getElementById("border").value+" "
	else
		tablehtml=tablehtml+"border=1"+" "
		
	if(document.getElementById("cellpad").value!="")
	  	tablehtml=tablehtml+"cellpadding="+document.getElementById("cellpad").value+" " 
	  	
	if(document.getElementById("cellspace").value!="")
		tablehtml=tablehtml+"cellspacing="+document.getElementById("cellspace").value+" "
	if(document.getElementById("bordercolor").value!="")
		tablehtml=tablehtml+"bordercolor="+document.getElementById("bordercolor").value+" " 
	if(document.getElementById("bgcolor").value!="")
		tablehtml=tablehtml+"bgcolor="+document.getElementById("bgcolor").value+" "
	if(document.getElementById("checkbox0").checked==true)
	{
		if(document.getElementById("pwidth").value!="")
		{
			tablehtml=tablehtml+"width="+document.getElementById("pwidth").value;
		 	if (radio=="1") 
				tablehtml=tablehtml+"%"+"";
			else
				tablehtml=tablehtml+""+"";	
		}	 
	}
	
	else 
		tablehtml=tablehtml+"width=100%";
	   	
	tablehtml=tablehtml+">";
	for (i=1;i<=document.getElementById("rows").value;i++)
	{
	 tablehtml=tablehtml+"<tr>";
		 for (j=1;j<=document.getElementById("columns").value;j++)
		 	if (document.getElementById("columns").value>1)
		   		{tablehtml=tablehtml+"<td width=\"" + parseInt(100/document.getElementById("columns").value) + "%\">"+innerHTML+"</td>";}
		   	else
		   		{tablehtml=tablehtml+"<td>"+innerHTML+"</td>";}
		 tablehtml=tablehtml+"</tr>";
	 }
	  
	tablehtml= tablehtml+"</table>"; 
	return tablehtml;

}
</script>

</head>
<body class="dialog">
<script language="javascript" type="text/javascript">dialogTitle("lang_inserttable")</script>

<table border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td colspan="4">
    	<table border="0" cellspacing="0" cellpadding="0" width="100%">
          <tr>
			<td class="subtitle"><script language="javascript" type="text/javascript">dialogPrintlang("lang_size")</script></td>
			<td class="hr"> 
			 <hr size="1" color="#B3AC9D">
			</td>
          </tr>
        </table>
    </td>
    </tr>
    <tr> 
      
    <td width="104" align="center"><script language="javascript" type="text/javascript">dialogPrintlang("lang_rows")</script></td>
      
    <td width="60"> 
		<input id="rows" size="9" maxlength="2" value="1" class="dialogInput" datatype="number">
    </td>
      
    <td width="87" align="center"><script language="javascript" type="text/javascript">dialogPrintlang("lang_columns")</script></td>
      
    <td width="60"> 
    	<input id="columns" size="9" maxlength="2" value="1" class="dialogInput" datatype="number">
    </td>
    </tr>
    <tr> 
      <td colspan="4"> 
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
          <tr>
			<td class="subtitle"><script language="javascript" type="text/javascript">dialogPrintlang("lang_layout")</script></td>
			<td class="hr"> 
			 <hr size="1" color="#B3AC9D">
			</td>
          </tr>
        </table>
 </td>
    </tr>
    <tr> 
      
    <td width="104"><script language="javascript" type="text/javascript">dialogPrintlang("lang_align")</script></td>
      
    <td width="60"> 
      <select id="align" class="input" size="1">
    	<option value=""><script language="javascript" type="text/javascript">dialogPrintlang("lang_default")</script></option>
    	<option value="left"><script language="javascript" type="text/javascript">dialogPrintlang("lang_align_left")</script></option>
    	<option value="center"><script language="javascript" type="text/javascript">dialogPrintlang("lang_align_center")</script></option>
    	<option value="right"><script language="javascript" type="text/javascript">dialogPrintlang("lang_align_right")</script></option>
    	<option value="justify"><script language="javascript" type="text/javascript">dialogPrintlang("lang_align_justify")</script></option>
      </select>
    </td>
      <td colspan="2" width="149"> 
        <input type="checkbox" value="1" id="checkbox0" onclick="javascript:__checkbox0_onclick();">
        <script language="javascript" type="text/javascript">dialogPrintlang("lang_width")</script>           
       </td> 
    </tr> 
    <tr>
    	<td width="104"><script language="javascript" type="text/javascript">dialogPrintlang("lang_border")</script></td>
        <td width="60"><input id="border" size="9" maxlength="2" value="1" class="dialogInput" datatype="number"></td>
	    <td rowspan="2" width="87" valign="top" align="right"> 
			<div align="center"> 
			  <input id="pwidth" size="9" maxlength="3" value="100" class="dialogInput" disabled datatype="number">
			</div>
	    </td>
        <td width="60"> 
	      <input type="radio"  value="0" name="radio" disabled id="radio1"><script language="javascript" type="text/javascript">dialogPrintlang("lang_pixel")</script>         
	    </td>
    </tr>
    <tr> 
            
    	<td width="104"><script language="javascript" type="text/javascript">dialogPrintlang("lang_cellpadding")</script></td>           
        <td width="60"><input id="cellpad" size="9" maxlength="2" value="0" class="dialogInput" datatype="number"></td>           
        <td width="60"><input type="radio" name="radio" value="1" checked disabled id="radio2"><script language="javascript" type="text/javascript">dialogPrintlang("lang_percent")</script></td>           
    </tr>           
    <tr>
           
    <td width="104"><script language="javascript" type="text/javascript">dialogPrintlang("lang_cellspacing")</script></td>           
    <td width="60">
		<input id="cellspace" size="9" maxlength="2" value="0" class="dialogInput" datatype="number">           
    </td>           
           
    <td width="87"></td>           
           
    <td width="60"></td>           
    </tr>           
    <tr>
      <td colspan="4">     
      	<table border="0" cellspacing="0" cellpadding="0" width="100%">     
          <tr>     
		     <td class="subtitle"><script language="javascript" type="text/javascript">dialogPrintlang("lang_color")</script></td>     
		     <td class="hr">      
		         <hr size="1" color="#B3AC9D">
		     </td>
          </tr>
        </table>
      </td>
    </tr>
	<tr>
		<td width="104"><script language="javascript" type="text/javascript">dialogPrintlang("lang_border_color")</script></td>           
		<td>
		  <input id="bordercolor" size="7" maxlength="7" class="dialogInput" value=#000000><INPUT id=setsbordercolor type=button class="BtnSelectColor" onclick="javascript:selectColorIntoInput('bordercolor',this);">
		</td>
		<td align="center"><script language="javascript" type="text/javascript">dialogPrintlang("lang_background_color")</script></td>  
		<td>
			<input id="bgcolor" size="7" maxlength="7" value="#ffffff" class="dialogInput"><INPUT id=setbgcolor type=button class="BtnSelectColor" onclick="javascript:selectColorIntoInput('bgcolor',this);">
		</td>           
	</tr>           
    <tr>
      <td colspan="4" class="hr">
        <hr size="1" color="#B3AC9D">
      </td>
    </tr>
    <tr>
      <td colspan="4" align="right">
    	<script language="javascript" type="text/javascript">
    		PrintButtons2();
    	</script>
      </td>
    </tr>
  </table>   

</body>
</html>     
